/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Server.MyDataType;

import java.util.Vector;

/**
 *
 * @author CANG
 */
public class MyRowData 
{
    public String ID = "null";
    public Vector<String> _vtRow;
    
    public MyRowData()
    {
       _vtRow = new Vector<String>();
    }
    
    public int getLength()
    {
       return _vtRow.size();
    }
    
    public String index(int i)
    {
       return _vtRow.elementAt(i);
    }

    public void setData(Vector<String> vtData)
    {
       _vtRow = vtData;
    }
    
    public boolean isSameRow(MyRowData row)
    {
        /*
        for(int i = 0; i<this.getLength(); i++)
        {
            for(int j = 0; j<row.getLength(); j++)
            {
                if(this.index(i) == null ? row.index(j) != null : !this.index(i).equals(row.index(j)))
                    return false;
            }
        }*/
        if(this._vtRow.equals(row._vtRow))
            return true;
        
        return false;
    }
    
    public boolean UpdateMyRowData(int indexAtt, String value)
    {
        if(indexAtt >= _vtRow.size() || indexAtt < 0)
            return false;
        
        this._vtRow.set(indexAtt, value);
        
        return true;
    }
}
